package com.example.demo.service;

import com.example.demo.entity.Org;
import com.example.demo.mapper.OrgMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrgServiceImpl implements IOrgService {

    @Autowired
    private OrgMapper orgMapper;

    @Override
    public Org getOrgById(Integer id) {
        return orgMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Org> findAllOrgs(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return orgMapper.selectAllOrgs();
    }
}
